<template>
  <a-collapse accordion @change="changeActivekey">
    <a-collapse-panel v-for="item in this.tableData" :key="item.objectId" :header="item.label">
      <AbstractionForm :edit-data="item"></AbstractionForm>
    </a-collapse-panel>
  </a-collapse>
</template>

<script>
import AbstractionForm from "@/pages/systemManage/abstractionList/AbstractionForm";
import {find} from 'lodash'
import {mapMutations} from "vuex";

export default {
  name: "CollapseBody",
  components: {AbstractionForm},
  props: {
    tableData: Array
  },
  methods: {
    ...mapMutations('abstractionList', ['setState']),
    changeActivekey(key) {
      this.setState({name: 'editData', value: find(this.tableData, {objectId: key})})
      this.setState({name: 'currentEditKey', value: key})
    }
  }
}
</script>

<style scoped>

</style>
